<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var arr = [
        { short: "lz", name: "柳州" },
        { short: "sz", name: "深圳" },
        { short: "st", name: "汕头" }
      ];

      const obj = {
        A: [],
        B: [],
        S: [],
        L: []
      };

      arr.forEach((item) => {
        const key = item.short[0].toUpperCase();
        obj[key].push(item);
      });

      console.log(obj);
    </script>
  </body>
</html>
